﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LMIS_Application.books
{
    public partial class BookCheckin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnBookCheckIn_Click(object sender, EventArgs e)
        {
            int invId = Convert.ToInt32(tb_CI_InvId.Text);
            Inv bkCopy = new Inv();
            bkCopy.loadInventory(invId);
            bool success = bkCopy.Checkin();

            string message = String.Empty;
            if (success)
            {
                message = "Your book was checked in successfully.";
            }
            else
            {
                message = "We could not process this book check-in";
            }

            msgSuccess.InnerHtml = message;
        }
    }
}
